package com.coco.group.mapper;

import com.coco.group.pojo.TbGroupBuyItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @program: coco
 * @author: Mr.Lin
 * @create: 2021-07-29 20:57
 **/
@Mapper
public interface GroupBuyItemMapper {

    void add(TbGroupBuyItem item);

    /**
     * 查询单条
     * @param itemId 主键
     * @return
     */
    TbGroupBuyItem findById(Long itemId);


    List<TbGroupBuyItem> findByGoodsId(Long goodsId);

    /**
     * 修改库存
     * @param itemId
     * @param i
     * @return
     */
    int updateStock(@Param("itemId") Long itemId,
                    @Param("num") int num);

    void deleteStatus(Long id);
}
